package cn.etynit.feign;

import cn.etynit.domain.UserMovie;
import cn.etynit.fallback.MovieServiceFallbackFactory;
import cn.etynit.fallback.UserMovieServiceFallbackFactory;
import cn.etynit.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-movie",path = "/userMovie",contextId = "userMovieService",fallbackFactory = UserMovieServiceFallbackFactory.class)
public interface UserMovieService {
    @RequestMapping(value = "/{userId}/{movieId}",method = RequestMethod.GET)
    JsonResult getUserStock(@PathVariable("userId")Long userId, @PathVariable("movieId")Long movieId);

    @RequestMapping(value="/save",method= RequestMethod.POST)
    JsonResult saveOrUpdate(@RequestBody UserMovie userMovie);
}
